I am using smtplib to send emails with my SMTP server as localhost and port number 25 in a ubuntu machine. It was working fine until I got connection limit exceeded error. The stack trace is as follows:
File "/src/tasks/driver/sendEmail.py", line 57, in run
s = smtplib.SMTP(smtp)
File "/root/anaconda/lib/python2.7/smtplib.py", line 258, in __init__
raise SMTPConnectError(code, msg)
SMTPConnectError: (421, '4.3.2 Connection rate limit exceeded.')
People suggested to edit /etc/mail/sendmail.mc file to change the window size and throttle.
define(confCONNECTION_RATE_THROTTLE',15')dnl
define(confCONNECTION_RATE_WINDOW_SIZE',60s')dnl
The real problem is I don't see any such configuration file. No traces of sendmail installation in the docker image or the host machine. How does smtplib send emails with localhost as the smtp server? How to increase the throttle if I don't have the configuration file in the machines? Is it because my company manages the SMTP server for all the machines in a separate file?